Configure Endpoints
Endpoints in API Manager are the specific URLs or paths through which external clients can access the functionalities provided by an API. These endpoints define the entry points for making requests to interact with the API's resources, allowing clients to perform various operations such as retrieving data, updating information, or executing specific tasks.
Configure a Production Endpoint Using Static Routing (API Level)
- Navigate to the API's End Points tab.
The Screen appears as shown below.

- Ensure that API Level tab is selected.
The Resource Level tab is disabled by default; it is enabled after the Backend is selected/Basepath is updated and saved in API level.
-
Ensure that Type of Routing is selected as Static Routing.
-
Select Backendpoint from the drop down.
-
Select the Protocol as either HTTP or HTTPS as per the requirement.
-
Enter the Basepath.
The basepath is automatically retrieved from the selected backend. Whereas the user can update it if necessary.
By default, the Backend Type is set to the same as the API Type.
-
Update/select the Backend Type if necessary.
-
Select Gateway you want to map from the drop down if necessary.
-
Select Endpoint Security from the drop down.
None: Choose None if you do not want any security for the endpoint.
Linked to Backend: When authentication is linked to the backend, the Gateway replaces subscription-level credentials in message headers with credentials provided at the backend server security level and authentication occurs at the backend server level.
Basic Authentication: When the user selects Basic Authentication, the Gateway authenticates the user credentials (User ID and Password) and then replaces them with those from backend security to allow authentication at the backend endpoint level.
Pass-through: When the user selects pass-through authentication as the API endpoint security, the message is allowed to pass through the Gateway without being processed or altered and the backend server authenticates the credentials passed in the message before returning the response to the client.
WS Security (Only for SOAP APIs): WS Security is similar to Basic Authentication, however it is designed for SOAP messages.
If Basic Authentication or WS Security is selected as Endpoint Security, enter the User name and Password.


- Click Save as Draft.
On saving, the confirmation message appears as shown below.

Configure a Sandbox Endpoint
-
Navigate to the API's End Points tab.
-
Scroll down to the sandbox section.
The screen appears as shown below.

Sandbox is disabled by default.
-
Enable the toggle to enable the Sandbox section.
-
Ensure that Type of Routing is selected as Static Routing.
-
Select Backendpoint from the drop down.
-
Select the Protocol as either HTTP or HTTPS as per the requirement.
-
Enter the Basepath.
-
Select Gateway you want to map from the drop down if necessary.
-
Enter the Exposure Path.
Exposure Path is automatically obtained from the selected backend and the user may modify it if necessary.
- Select Endpoint Security from the drop down.
If Basic Authentication or WS Security is selected as Endpoint Security, enter the User name and Password.


- Click Save as Draft.
On saving, the confirmation message appears as shown below.

Configure a Production Endpoint Using Dynamic Routing (API Level)
When configuring Endpoints with Dynamic Routing scripts, use the Backend Server Name (not the port or IP) to route requests to the appropriate Backend Server.
- Navigate to the API's End Points tab.
The screen appears as shown below.

- Enter the Script for Dynamic Routing.
By default, the Backend Type is set to the same as the API Type.
-
Update/select the Backend Type if necessary.
-
Select Gateway you want to map from the drop down if necessary.
-
Select Endpoint Security from the drop down.
Exposure Path is automatically obtained from the selected backend and the user may modify it if necessary.
- Click Save as Draft.
On saving, the confirmation message appears as shown below.

The following is the method used in Dynamic Routing script.
| Method name | Method Description |
|---|---|
| routeRequest() | Use this method to set the actual URI dynamically |
The helper methods used in Dynamic Routing script are as follows:
| Method name | Method Description | Parameter | Parameter Description |
|---|---|---|---|
| getHeaderValue(Key) | Use this method to get http header value for the incoming request | key | key passed in http request header |
| setTarget(protocol, backendName, basePath) | Use this method to set the actual URI for the real backend | protocol | should be http or https |
| backendName | Name of the Backend where the request will be processed | ||
| basePath | Actual Base URL |
Sample Dynamic Routing script
var obj = new Object();
obj.routeRequest = function(dynamicRouting)
{
var headerValue = dynamicRouting.getHeaderValue("X-SSL-client-s-dn");
var result = headerValue.split("CN=");
StringFinalHeaderVal = result[result.length-1];
if(StringFinalHeaderVal == "PERF")
{
dynamicRouting.setTarget("http,ThbsOSBPerf,/sim/autostub/Enterprise/JaxwsWebservice/jaxwsWebservice");
}else{
dynamicRouting.setTarget("http,ThbsOSBSoap,/sim/autostub/Enterprise/Webservice/jaxwsWebservice");
}
return dynamicRouting;
}
When using a dynamic routing script with backend server dependencies, ensure that all servers are propagated to the appropriate Gateways regardless of the API version.
Configure a Endpoint at Resource Level (Static)
The Resource Level tab is disabled by default; it is enabled after the Backend is selected/ Basepath is updated and saved in the API level.
- Navigate to the API's End Points tab.
The screen appears as shown below.

- Select the Resource Level tab.
The Routing Type displayed in the Resource Level ID is determined by the Type of Routing set at the API level.
- Click the Edit icon of the respective resource.
Routing Type dialog box appears as shown below.
-
Select the Routing as Static.
-
Select Backendpoint from the drop down.
-
Select the Protocol as either HTTP or HTTPS as per the requirement.
-
Enter the Basepath.
-
Click Save.
On saving, the Routing type of the respective resource is set to Static.

Configure a Endpoint at Resource Level (Dynamic)
The Resource Level tab is disabled by default; it is enabled after the Backend is selected/ Basepath is updated and saved in the API level.
- Navigate to the API's End Points tab.
The screen appears as shown below.

- Select the Resource Level tab.
The Routing Type displayed in the Resource Level ID is determined by the Type of Routing set at the API level.
- Click the Edit icon of the respective resource.
Routing Type dialog box appears as shown below.
-
Select the Routing as Dynamic.
-
Enter the Script for Dynamic Routing.
-
Click Save.
On saving, the Routing type of the respective resource is set to Dynamic.

Sample Dynamic Routing script
var obj = new Object();
obj.routeRequest = function(dynamicRouting){
var xml = dynamicRouting.getPayload();
var xpath = "//orderStatusEvent/@orderCode";
var namespace = "";
var value = "CB2z8ule1njiwd-2uxwi";
var type = "attribute";
if (dynamicRouting.isXmlElement(xml, xpath, namespace, value, type)) {
dynamicRouting.setTarget("http,Mock Backend,/xmlValidation/mock");
} else {
dynamicRouting.setTarget("http,ThbsBackend,/services/helloservice_1_0");
}
return dynamicRouting;
}